package com.atguigu.gulimall.member.service;

import com.atguigu.gulimall.member.exception.PhoneExistException;
import com.atguigu.gulimall.member.exception.UserNameExistException;
import com.atguigu.gulimall.member.vo.MemberRegistVo;
import com.atguigu.gulimall.member.vo.SocialUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.member.entity.MemberEntity;

import java.util.Map;

/**
 * 会员
 *
 * @author bihe
 * @email 1067716908@qq.com
 * @date 2023-04-09 15:51:25
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void regist(MemberRegistVo vo) throws UserNameExistException, PhoneExistException;

    void checkUserNameExist(String userName) throws UserNameExistException;

    void checkPhoneExist(String phone) throws PhoneExistException;

    /**
     * 登录验证
     * @param vo
     * @return
     */
    MemberEntity login(MemberEntity vo);

    /**
     * 社交登录
     * @param user
     * @return
     */
    MemberEntity login(SocialUser user) throws Exception;
}

